#include "sPointer.h"
#include "sString.h"

sPointer::sPointer():ptr(0){}
sPointer::sPointer(sString const &n)
{
	ptr = new sString(n);
}
sPointer::~sPointer()
{
	delete ptr;
}
sString &sPointer::operator*() 
{
	if (!ptr)
		throw errorMessage;
	return *ptr; 
}
sString *sPointer::operator->() const 
{
	if (!ptr)
		throw errorMessage;
	return ptr;
}

sString sPointer::errorMessage("Uninitialized sPointer(smart_pointer)");
